<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>文章列表</title>
<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .ava{
            width:40px;
            height: 40px;
            cursor: pointer;
        }
    </style>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; 文章列表 <span>(${message("admin.page.total", page.total)})</span>
	</div>
	<form id="listForm" action="list.htm" method="get">
		<div class="bar">
			<a href="add.htm" class="iconButton" id="addButton">
				<i class="iconfont icon-anonymous-iconfont1">&nbsp;</i>${message("admin.common.add")}
			</a>
			<div class="buttonWrap">
				<a href="javascript:" id="deleteButton" class="iconButton disabled">
					<i class="iconfont icon-icon27">&nbsp;</i>${message("admin.common.delete")}
				</a>
				<a href="javascript:" id="refreshButton" class="iconButton">
					<i class="iconfont icon-shuaxin1">&nbsp;</i>${message("admin.common.refresh")}
				</a>
				<div class="menuWrap">
					<a href="javascript:" id="pageSizeSelect" class="button">
						${message("admin.page.pageSize")}<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu">
						<ul id="pageSizeOption">
							<li>
								<a href="javascript:"[#if page.pageSize == 10] class="current"[/#if] val="10">10</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 20] class="current"[/#if] val="20">20</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 50] class="current"[/#if] val="50">50</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 100] class="current"[/#if] val="100">100</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text" id="searchValue" name="searchValue" value="${page.searchValue}" maxlength="200" placeholder="请输入搜索条件" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li>
							<a href="javascript:"[#if page.searchProperty == "member.username"] class="current"[/#if] val="member.username">作者</a>
						</li>
						<li>
							<a href="javascript:"[#if page.searchProperty == "title"] class="current"[/#if] val="title">标题</a>
						</li>
                        <li>
                            <a href="javascript:"[#if page.searchProperty == "category.name"] class="current"[/#if] val="category.name">分类</a>
                        </li>
					</ul>
				</div>
			</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check">
					<input type="checkbox" id="selectAll" />
				</th>
				<th>
					<a href="javascript:" class="sort" name="title">标题</a>
				</th>
                <th>
                    <a href="javascript:">封面</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="username">作者</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="name">分类</a>
                </th>
				<th>
                    <a href="javascript:" class="sort" name="createDate">创建时间</a>
                </th>
				<th>
                    <span>${message("admin.common.handle")}</span>
                </th>
			</tr>
			[#list page.content as essay]
				<tr>
					<td>
						<input type="checkbox" name="ids" value="${essay.id}" />
					</td>
					<td>
						${essay.title}
					</td>
                    <td>
                        <img src="${(essay.imageURL)!"/resources/admin/images/default.png"}" class="ava" />
                    </td>
                    <td>
						[#if essay.member??]
							${essay.member.username}(${essay.member.name})
						[/#if]
                    </td>
                    <td>
						[#if essay.category??]
							<span class="am-badge am-badge-secondary am-radius">${essay.category.name}</span>
						[/#if]
                    </td>
					<td>
                        ${essay.createDate?string("yyyy-MM-dd HH:mm:ss")}
                    </td>
					<td>
						<a href="edit.htm?id=${essay.id}"><i class="iconfont icon-bianji edit-icon" ></i></a>
					</td>
				</tr>
			[/#list]
		</table>
		[@pagination pageNumber = page.pageNumber totalPages = page.totalPages]
			[#include "/admin/include/pagination.ftl"]
		[/@pagination]
	</form>
</body>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript">
    $().ready(function() {
        $(".ava").on("click", function() {
            window.open($(this).attr("src"));
        })
	[@flash_message /]

    });
</script>
</html>
